home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2008 May
/
PCWorld_2008-05_cd.bin
/
Audio-video
/
audials
/
audialsTV-setup.exe
/
[0]
/
MusicTv.js
< prev
next >
Wrap
Text (UTF-16)
|
2008-03-14
|
61KB
|
893 lines
var L_PREVIOUS_TEXT = "Previous";
var L_PLAY_TEXT = "Play";
var L_STOP_TEXT = "Stop";
var L_NEXT_TEXT = "Next";
var L_MUTE_TEXT = "Mute";
var L_UNMUTE_TEXT = "Loud";
var L_VOLUP_TEXT = "Volume up";
var L_VOLDOWN_TEXT = "Volume down";
var L_AppName = "Audials TV";
var g_DockedWidth = 130;
var g_DockedHeight = 97;
var g_toolbarHeight_s = 23;
var g_toolbarHeight_b = 33;
var g_toolbarWidth = 124;
var g_headerHeight_s = 17;
var g_headerHeight_b = 23;
var g_UnDockedWidth = 320;
var g_UnDockedHeight = 240;
var g_bAllVisible = true;
var g_Volume = 50;
var g_HideDelay = 3000;
var g_bgTileSize = 40;
var restoretimer;
var oShell = new ActiveXObject("WScript.Shell");
function LoadFlyout()
{
var table = selectedChannels;
var player = System.Gadget.document.parentWindow.MusicTv;
var captionText = System.Gadget.document.parentWindow.captionText;
// Iterate through the rows.
var channelID = player.GetNextChannel(0);
while(channelID != 0)
{
var bSelected = player.IsChannelSelected(channelID);
if(bSelected)
{
var row = table.insertRow();
row.height = 12;
var cell = row.insertCell();
var channelName = player.GetChannelName(channelID);
cell.innerText = channelName;
cell.onclick = OnChannelClick;
cell.id = channelID;
cell.onmouseenter = OnChannelHover;
cell.onmouseout = OnChannelOut;
cell.style.color = "white";
cell.style.width = 140;
if(captionText && captionText.innerText == channelName)
{
cell.style.backgroundColor = "#323232";
cell.style.color = "white";
}
}
channelID = player.GetNextChannel(channelID);
}
}
function OnSenderHover()
{
var oImg = System.Gadget.Flyout.document.getElementById("channels-sender");
oImg.src = 'resources/toolbar_big/channels_sender_hov.png';
}
function OnSenderOut()
{
var oImg = System.Gadget.Flyout.document.getElementById("channels-sender");
oImg.src = 'resources/toolbar_big/channels_sender_rest.png';
}
function OnSenderClick()
{
// There is no way to open the settings UI directly,
// so we simulate key presses:
// <shift-F10> opens the context menu
// 2x <arrow up>
// <enter>
// (using the 'o' hotkey from Options isn't safe enough
// for other languages than german/english)
//
// The context menu can only be opened if the flyout
// is closed. We register an onHide handler, close the
// the flyout and send the proper keystrokes inside the
// event handler.
System.Gadget.Flyout.onHide = OnSenderClick2;
// close the flyout
System.Gadget.Flyout.show = false;
}
function OnSenderClick2() {
// reset event handler
System.Gadget.Flyout.onHide = function() {};
// send keys to open settings UI
oShell.SendKeys('+{F10}{UP 2}{ENTER}');
}
function OnChannelHover()
{
this.style.color = "#9f9f9f";
}
function OnChannelOut()
{
this.style.color = "white";
}
function OnChannelClick()
{
var player = System.Gadget.document.parentWindow.MusicTv;
System.Gadget.document.parentWindow.storage.innerText = this.id;
player.PlayChannel(this.id);
System.Gadget.document.parentWindow.bar_play.style.display="none";
System.Gadget.document.parentWindow.bar_stop.style.display="";
System.Gadget.document.parentWindow.barB_play.style.display="none";
System.Gadget.document.parentWindow.barB_stop.style.display="";
var channelName = player.GetChannelName(this.id);
var headerText = System.Gadget.document.parentWindow.captionText;
headerText.innerText = channelName;
// hide channel list
ShowChannels();
}
function ShowChannels()
{
if(System.Gadget.Flyout.show)
{
System.Gadget.Flyout.show = false;
System.Gadget.document.parentWindow.head_s_channels_in.style.display="none";
System.Gadget.document.parentWindow.head_s_channels_out.style.display="";
System.Gadget.document.parentWindow.head_b_channels_in.style.display="none";
System.Gadget.document.parentWindow.head_b_channels_out.style.display="";
}
else
{
System.Gadget.Flyout.show = true;
System.Gadget.document.parentWindow.head_s_channels_in.style.display="";
System.Gadget.document.parentWindow.head_s_channels_out.style.display="none";
System.Gadget.document.parentWindow.head_b_channels_in.style.display="";
System.Gadget.document.parentWindow.head_b_channels_out.style.display="none";
}
}
function LoadSettings()
{
var table = allChannels;
var player = System.Gadget.document.parentWindow.MusicTv;
// Iterate through the rows.
var channelID = player.GetNextChannel(0);
while(channelID != 0)
{
var bSelected = player.IsChannelSelected(channelID);
var strName = player.GetChannelName(channelID);
var strGenre = player.GetChannelGenre(channelID);
var strLanguage = player.GetChannelLanguage(channelID);
var row = table.insertRow();
var cellck = row.insertCell();
if(bSelected)
cellck.innerHTML = "<input type='checkbox' checked = true >";
else
cellck.innerHTML = "<input type='checkbox'>";
cellck.onclick = OnSelectChannel;
cellck.id = channelID;
cellck.width = 20;
var cellName = row.insertCell();
cellName.innerText = strName;
cellName.width = 130;
var cellGenre = row.insertCell();
cellGenre.innerText = strGenre;
cellGenre.width = 65;
var cellLanguage = row.insertCell();
cellLanguage.innerText = strLanguage;
cellLanguage.width = 65;
channelID = player.GetNextChannel(channelID);
}
}
function OnSelectChannel()
{
var player = System.Gadget.document.parentWindow.MusicTv;
var bSelected = player.IsChannelselected(this.id)
if(bSelected)
player.MarkChannel(this.id, false);
else
player.MarkChannel(this.id, true);
}
// read application settings
function GetAudialsTVSettings()
{
this.g_Volume = System.Gadget.Settings.read("LastVolume");
if(g_Volume == "")
g_Volume = 50;
var channel = System.Gadget.Settings.read("LastChannel");
if(channel == "")
channel = GetNextSelectedChannel(0);
System.Gadget.document.parentWindow.storage.innerText = channel;
}
// save application settings
function PutAudialsTVSettings()
{
System.Gadget.Settings.write("LastVolume", g_Volume);
var channel =System.Gadget.document.parentWindow.storage.innerText;
if(channel == "")
channel = GetNextSelectedChannel(0);
System.Gadget.Settings.write("LastChannel", channel);
}
function GadgetUnload()
{
MusicTv.ShutDown();
PutAudialsTVSettings();
}
function GadgetLoad()
{
System.Gadget.document.parentWindow.storage.style.visibility = "hidden";
MusicTv.InitializeControl();
MusicTv.UpdateChannelList("http://musictv.audials.com/updatechannels_gadget.txt");
GetAudialsTVSettings();
var currentChanelID =System.Gadget.document.parentWindow.storage.innerText;
MusicTv.PlayChannel(currentChanelID);
var channelName = MusicTv.GetChannelName(currentChanelID);
captionText.innerText = channelName;
MusicTv.SetVolume(g_Volume);
HideToolbars();
System.Gadget.settingsUI = "settings.html";
System.Gadget.Flyout.file = "flyout.html";
System.Gadget.onUndock = ViewVideo;
System.Gadget.onDock = ViewVideo;
// make the navigation bar
//gPageDir = document.getElementsByTagName("html")[0].dir;
smallToolbar.innerHTML = "prev play stop next volUP volDOWN mute unmute";
bigToolbar.innerHTML = "prev play stop next volUP volDOWN mute unmute";
MakeBigHeader();
MakeSmallHeader();
MakeSmallToolbar(smallToolbar);
MakeBigToolbar(bigToolbar);
setAltLabels();
head_s_channels_in.style.display="none";
head_s_channels_out.style.display="";
head_b_channels_in.style.display="none";
head_b_channels_out.style.display="";
bar_play.style.display="none";
bar_stop.style.display="";
barB_play.style.display="none";
barB_stop.style.display="";
bar_mute.style.display="";
bar_unmute.style.display="none";
barB_mute.style.display="";
barB_unmute.style.display="none";
}
// creates toolbar
function MakeSmallToolbar(controlsString)
{
var controlsArray=controlsString.innerText.split(" ");
var controlName;
var newImageToAdd;
var newLabelToAdd;
var labelsForRollovers = "";
var imageRollovers = "<div id='smallBkgBar'></div><div id='smallButtonBar'>";
var i=0;
while(controlName=controlsArray[i++])
{
var controlNameAction = controlName;
newImageToAdd = "<a id='link_" + controlNameAction + "' href='javascript:void(0);' onClick='this.blur();'>"
+ "<img border=0 id='bar_" + controlNameAction + "' hspace='1' src='resources/toolbar_small/"+controlName+"_rest.png' "
+ "onMouseOver='src=\"resources/toolbar_small/" + controlName + "_hov.png\"' onMouseOut='src=\"resources/toolbar_small/" + controlName + "_rest.png\"' "
+ "onMouseDown='src=\"resources/toolbar_small/" + controlName + "_down.png\"' onMouseUp='src=\"resources/toolbar_small/" + controlName + "_hov.png\";"
+ "onAction(\"" + controlNameAction + "\");' \>"
+ "</a>";
newLabelToAdd = "<label for='link_"+controlName+"'>"+controlName+"</label>";
imageRollovers += newImageToAdd;
labelsForRollovers += newLabelToAdd;
}
imageRollovers += "</div>";
controlsString.innerHTML=imageRollovers;
//tooltips.innerHTML=labelsForRollovers;
}
function MakeBigToolbar(bigToolbar)
{
var controlsArray=bigToolbar.innerText.split(" ");
var controlName;
var newImageToAdd;
var newLabelToAdd;
var labelsForRollovers = "";
var imageRollovers = "<div class='toolbutton' id='bigBkgBarL'></div>";
imageRollovers += "<div class='toolbutton' id='bigBkgBarC'></div>";
imageRollovers += "<div class='toolbutton' id='bigBkgBarR'></div>";
imageRollovers += "<div id='bigButtonBar'>";
var i=0;
while(controlName=controlsArray[i++])
{
var controlNameAction = controlName;
newImageToAdd = "<a class='toolbutton' id='link_" + controlNameAction + "' href='javascript:void(0);' onClick='this.blur();'>"
+ "<img class='toolbutton' id='barB_" + controlNameAction + "' hspace='0' src='resources/toolbar_big/"+controlName+"_rest.png' "
+ "onMouseOver='src=\"resources/toolbar_big/" + controlName + "_hov.png\"' onMouseOut='src=\"resources/toolbar_big/" + controlName + "_rest.png\"' "
+ "onMouseDown='src=\"resources/toolbar_big/" + controlName + "_down.png\"' onMouseUp='src=\"resources/toolbar_big/" + controlName + "_hov.png\";"
+ "onAction(\"" + controlNameAction + "\");' \>"
+ "</a>";
newLabelToAdd = "<label for='link_"+controlName+"'>"+controlName+"</label>";
// i don't know how to make space. please make it better Cristi
if (i == 5)
imageRollovers += " ";
imageRollovers += newImageToAdd;
labelsForRollovers += newLabelToAdd;
}
imageRollovers += "</div>";
bigToolbar.innerHTML=imageRollovers;
//tooltips.innerHTML=labelsForRollovers;
AddSizeButtons(bigToolbar);
}
function AddSizeButtons(bigToolbar)
{
var sizeButtons = "size_1x size_2x size_4x";
var controlsArray=sizeButtons.split(" ");
var controlName;
var divSizeButtons = "<div id='bigSizeBar'>";
var i=0;
while(controlName=controlsArray[i++])
{
var controlNameAction = controlName;
newSizeButton = "<a id='link_" + controlNameAction + "' href='javascript:void(0);' onClick='this.blur();'>"
+ "<img border=0 id='barB_" + controlNameAction + "' hspace='0' src='resources/toolbar_big/"+controlName+"_rest.png' "
+ "onMouseOver='src=\"resources/toolbar_big/" + controlName + "_hov.png\"' onMouseOut='src=\"resources/toolbar_big/" + controlName + "_rest.png\"' "
+ "onMouseDown='src=\"resources/toolbar_big/" + controlName + "_down.png\"' onMouseUp='src=\"resources/toolbar_big/" + controlName + "_hov.png\";"
+ "onAction(\"" + controlNameAction + "\");' \>"
+ "</a>";
divSizeButtons += newSizeButton;
}
divSizeButtons += "</div>";
bigToolbar.innerHTML += divSizeButtons;
}
// creates header toolbar
function MakeBigHeader()
{
var head_buttons = "<div class='toolbutton' id='bigHeaderBkgL'></div>";
head_buttons += "<div class='toolbutton' id='bigHeaderBkgC'></div>";
head_buttons += "<div class='toolbutton' id='bigHeaderBkgR'></div>";
head_buttons += "<div id='bigHeaderButtons'>";
var controlName = "channels_out";
var ButtonOut = "<a id='link_" + controlName + "' href='javascript:void(0);' onClick='this.blur();'>"
+ "<img border=0 id='head_b_" + controlName + "' hspace='1' src='resources/toolbar_big/"+controlName+"_rest.png' "
+ "onMouseOver='src=\"resources/toolbar_big/" + controlName + "_hov.png\"' onMouseOut='src=\"resources/toolbar_big/" + controlName + "_rest.png\"' "
+ "onMouseDown='src=\"resources/toolbar_big/" + controlName + "_down.png\"' onMouseUp='src=\"resources/toolbar_big/" + controlName + "_hov.png\";"
+ "onAction(\"" + controlName + "\");' \>"
+ "</a>";
head_buttons += ButtonOut;
controlName = "channels_in";
var ButtonIn = "<a id='link_" + controlName + "' href='javascript:void(0);' onClick='this.blur();'>"
+ "<img border=0 id='head_b_" + controlName + "' hspace='1' src='resources/toolbar_big/"+controlName+"_rest.png' "
+ "onMouseOver='src=\"resources/toolbar_big/" + controlName + "_hov.png\"' onMouseOut='src=\"resources/toolbar_big/" + controlName + "_rest.png\"' "
+ "onMouseDown='src=\"resources/toolbar_big/" + controlName + "_down.png\"' onMouseUp='src=\"resources/toolbar_big/" + controlName + "_hov.png\";"
+ "onAction(\"" + controlName + "\");' \>"
+ "</a>";
head_buttons += ButtonIn;
head_buttons += "</div>"
bigHeader.innerHTML += head_buttons;
}
function MakeSmallHeader()
{
var head_buttons = "<div>"
var controlName = "channels_out";
var ButtonOut = "<a id='link_" + controlName + "' href='javascript:void(0);' onClick='this.blur();'>"
+ "<img border=0 id='head_s_" + controlName + "' hspace='1' src='resources/toolbar_small/"+controlName+"_rest.png' "
+ "onMouseOver='src=\"resources/toolbar_small/" + controlName + "_hov.png\"' onMouseOut='src=\"resources/toolbar_small/" + controlName + "_rest.png\"' "
+ "onMouseDown='src=\"resources/toolbar_small/" + controlName + "_down.png\"' onMouseUp='src=\"resources/toolbar_small/" + controlName + "_hov.png\";"
+ "onAction(\"" + controlName + "\");' \>"
+ "</a>";
head_buttons += ButtonOut;
controlName = "channels_in";
var ButtonIn = "<a id='link_" + controlName + "' href='javascript:void(0);' onClick='this.blur();'>"
+ "<img border=0 id='head_s_" + controlName + "' hspace='1' src='resources/toolbar_small/"+controlName+"_rest.png' "
+ "onMouseOver='src=\"resources/toolbar_small/" + controlName + "_hov.png\"' onMouseOut='src=\"resources/toolbar_small/" + controlName + "_rest.png\"' "
+ "onMouseDown='src=\"resources/toolbar_small/" + controlName + "_down.png\"' onMouseUp='src=\"resources/toolbar_small/" + controlName + "_hov.png\";"
+ "onAction(\"" + controlName + "\");' \>"
+ "</a>";
head_buttons += ButtonIn;
head_buttons += "</div>"
smallHeader.innerHTML += head_buttons;
}
// set's alt tabs for navigation;
function setAltLabels()
{
bar_prev.setAttribute("alt",L_PREVIOUS_TEXT);
bar_play.setAttribute("alt",L_PLAY_TEXT);
bar_stop.setAttribute("alt",L_STOP_TEXT);
bar_next.setAttribute("alt",L_NEXT_TEXT);
bar_mute.setAttribute("alt",L_MUTE_TEXT);
bar_unmute.setAttribute("alt",L_UNMUTE_TEXT);
bar_volUP.setAttribute("alt",L_VOLUP_TEXT);
bar_volDOWN.setAttribute("alt",L_VOLDOWN_TEXT);
barB_prev.setAttribute("alt",L_PREVIOUS_TEXT);
barB_play.setAttribute("alt",L_PLAY_TEXT);
barB_stop.setAttribute("alt",L_STOP_TEXT);
barB_next.setAttribute("alt",L_NEXT_TEXT);
barB_mute.setAttribute("alt",L_MUTE_TEXT);
barB_unmute.setAttribute("alt",L_UNMUTE_TEXT);
barB_volUP.setAttribute("alt",L_VOLUP_TEXT);
barB_volDOWN.setAttribute("alt",L_VOLDOWN_TEXT);
}
// navigation controls
function onAction(action)
{
if (event.button == 2 || event.button == 3)
{
return false
}
else
{
var player = System.Gadget.document.parentWindow.MusicTv;
switch(action)
{
case "prev":
{
bar_play.style.display="none";
bar_stop.style.display="";
barB_play.style.display="none";
barB_stop.style.display="";
var currentChanelID = System.Gadget.document.parentWindow.storage.innerText;
var prevChannel = GetPreviousSelectedChannel(currentChanelID);
if(prevChannel == 0)
{
player.Stop();
}
else
{
currentChanelID = prevChannel;
System.Gadget.document.parentWindow.storage.innerText = currentChanelID;
player.PlayChannel(currentChanelID);
var channelName = player.GetChannelName(currentChanelID);
captionText.innerText = channelName;
}
}break;
case "play":
{
bar_play.style.display="none";
bar_stop.style.display="";
barB_play.style.display="none";
barB_stop.style.display="";
var currentChanelID = System.Gadget.document.parentWindow.storage.innerText;
player.PlayChannel(currentChanelID);
var channelName = player.GetChannelName(currentChanelID);
captionText.innerText = channelName;
}break;
case "stop":
{
bar_play.style.display="";
bar_stop.style.display="none";
barB_play.style.display="";
barB_stop.style.display="none";
player.Stop();
}break;
case "next":
{
bar_play.style.display="none";
bar_stop.style.display="";
barB_play.style.display="none";
barB_stop.style.display="";
var currentChanelID = System.Gadget.document.parentWindow.storage.innerText;
var nextChannel = GetNextSelectedChannel(currentChanelID);
if(nextChannel == 0)
{
player.Stop();
}
else
{
currentChanelID = nextChannel;
System.Gadget.document.parentWindow.storage.innerText = currentChanelID;
player.PlayChannel(currentChanelID);
var channelName = player.GetChannelName(currentChanelID);
captionText.innerText = channelName;
}
}break;
case "volUP":
{
if(g_Volume < 100)
{
g_Volume += 10;
player.SetVolume(g_Volume);
}
}break;
case "volDOWN":
{
if(g_Volume > 0)
{
g_Volume -= 10;
player.SetVolume(g_Volume);
}
}break;
case "mute":
{
bar_mute.style.display="none";
bar_unmute.style.display="";
barB_mute.style.display="none";
barB_unmute.style.display="";
player.Mute(true);
}break;
case "unmute":
{
bar_mute.style.display="";
bar_unmute.style.display="none";
barB_mute.style.display="";
barB_unmute.style.display="none";
player.Mute(false);
}break;
case "channels_in":
case "channels_out":
{
ShowChannels();
}break;
case "size_1x":
{
g_UnDockedWidth = 320;
g_UnDockedHeight = 240;
ViewAll();
}break;
case "size_2x":
{
g_UnDockedWidth = 640;
g_UnDockedHeight = 480;
ViewAll();
}break;
case "size_4x":
{
g_UnDockedWidth = 960;
g_UnDockedHeight = 720;
ViewAll();
}break;
}
}
}
function GetNextSelectedChannel(currentChannel)
{
var player = System.Gadget.document.parentWindow.MusicTv;
// iterate from current
var nextChannel = player.GetNextChannel(currentChannel);
while(nextChannel)
{
if(player.IsChannelSelected(nextChannel))
return nextChannel;
nextChannel = player.GetNextChannel(nextChannel);
}
// start from first one
nextChannel = player.GetNextChannel(0);
while(nextChannel)
{
if(player.IsChannelSelected(nextChannel))
return nextChannel;
nextChannel = player.GetNextChannel(nextChannel);
}
return 0;
}
function GetPreviousSelectedChannel(currentChannel)
{
var player = System.Gadget.document.parentWindow.MusicTv;
// iterate from current
var prevChannel = player.GetPreviousChannel(currentChannel);
while(prevChannel)
{
if(player.IsChannelSelected(prevChannel))
return prevChannel;
prevChannel = player.GetPreviousChannel(prevChannel);
}
// start from last one
prevChannel = player.GetPreviousChannel(0);
while(prevChannel)
{
if(player.IsChannelSelected(prevChannel))
return prevChannel;
prevChannel = player.GetPreviousChannel(prevChannel);
}
return 0;
}
function MouseOut()
{
if(event.toElement)
{
return;
}
clearTimeout(restoretimer);
restoretimer = setTimeout(HideToolbars, g_HideDelay);
}
function MouseIn()
{
clearTimeout(restoretimer);
if(event.fromElement)
{
return;
}
ShowToolbars();
clearTimeout(restoretimer);
}
function MoveOnVideo()
{
ViewAll();
//ShowToolbars();
}
function ShowToolbars()
{
if(g_bAllVisible)
return;
ViewAll();
}
function HideToolbars()
{
if(!g_bAllVisible)
return;
if(System.Gadget.Flyout.show)
return; // gadget flyout is visible, do not hide toolbars
ViewVideo();
}
function ViewVideo()
{
clearTimeout(restoretimer);
if(!System.Gadget.docked)
{
//undocked
with(document.body.style)
margin= 0,
width = g_UnDockedWidth,
height= g_UnDockedHeight + g_toolbarHeight_b + g_headerHeight_b;
smallHeader.style.visibility= "hidden",
bigHeader.style.visibility= "hidden",
captionText.style.visibility = "hidden";
with(MusicTv.style)
width = g_UnDockedWidth,
height= g_UnDockedHeight,
top = g_headerHeight_b,
left = 0;
with(smallToolbar.style)
visibility= "hidden";
with(bigToolbar.style)
visibility= "hidden";
}
else
{
//docked
with(document.body.style)
margin= 0,
width = g_DockedWidth,
height= g_DockedHeight + g_toolbarHeight_s + g_headerHeight_s;
smallHeader.style.visibility= "hidden",
bigHeader.style.visibility= "hidden",
captionText.style.visibility = "hidden";
with(MusicTv.style)
width = g_DockedWidth,
height= g_DockedHeight,
top = g_headerHeight_s,
left = 0;
with(smallToolbar.style)
visibility= "hidden";
with(bigToolbar.style)
visibility= "hidden";
}
g_bAllVisible = false;
}
function ViewAll()
{
clearTimeout(restoretimer);
restoretimer = setTimeout(HideToolbars, g_HideDelay);
if(!System.Gadget.docked)
{
//undocked
with(document.body.style)
margin= 0,
width = g_UnDockedWidth,
height= g_UnDockedHeight + g_toolbarHeight_b + g_headerHeight_b;
with(bigHeaderBkgC.style)
width = g_UnDockedWidth - 2*g_bgTileSize;
with(bigHeaderBkgR.style)
left = g_UnDockedWidth - g_bgTileSize;
with(bigHeader.style)
width = g_UnDockedWidth,
height= g_headerHeight_b,
visibility= "visible";
with(captionText.style)
visibility = "visible",
top = 3,
left = 50,
height = 19,
width = 220,
fontSize = 12,
fontWeight = "bold";
smallHeader.style.visibility = "hidden";
with(MusicTv.style)
width = g_UnDockedWidth,
height= g_UnDockedHeight,
top = g_headerHeight_b,
left = 0;
with(smallToolbar.style)
visibility= "hidden";
with(bigBkgBarC.style)
width = g_UnDockedWidth - 2*g_bgTileSize;
with(bigBkgBarR.style)
left = g_UnDockedWidth - g_bgTileSize;
with(bigToolbar.style)
visibility= "visible",
width = g_UnDockedWidth,
height= g_toolbarHeight_b,
top = g_UnDockedHeight + g_headerHeight_b,
left = 0;
}
else
{
//docked
with(document.body.style)
margin= 0,
width = g_DockedWidth,
height= g_DockedHeight + g_toolbarHeight_s + g_headerHeight_s;
with(smallHeader.style)
width = g_DockedWidth,
height= g_headerHeight_s,
visibility= "visible",
backgroundImage = "url(resources/header_bkg_s.png)";
with(captionText.style)
visibility = "visible",
top = 2,
left = 30,
height = 15,
width = 100,
fontSize = 11,
fontWeight = "normal";
bigHeader.style.visibility = "hidden";
with(MusicTv.style)
width = g_DockedWidth,
height= g_DockedHeight,
top = g_headerHeight_s,
left = 0;
with(smallToolbar.style)
width = g_toolbarWidth,
height= g_toolbarHeight_s,
top = g_DockedHeight + g_headerHeight_s,
left = (g_DockedWidth - g_toolbarWidth)/2,
visibility= "visible";
with(bigToolbar.style)
visibility= "hidden";
}
g_bAllVisible = true;
}
function PlayInvoked()
{
var player = System.Gadget.document.parentWindow.MusicTv;
bar_play.style.display="none";
bar_stop.style.display="";
barB_play.style.display="none";
barB_stop.style.display="";
var currentChanelID = System.Gadget.document.parentWindow.storage.innerText;
player.PlayChannel(currentChanelID);
var channelName = player.GetChannelName(currentChanelID);
captionText.innerText = channelName;
}
function SwitchToNext()
{
var player = System.Gadget.document.parentWindow.MusicTv;
var currentChanelID = System.Gadget.document.parentWindow.storage.innerText;
var nextChannel = GetNextSelectedChannel(currentChanelID);
if(nextChannel == 0)
{
player.Stop();
}
else
{
currentChanelID = nextChannel;
System.Gadget.document.parentWindow.storage.innerText = currentChanelID;
player.PlayChannel(currentChanelID);
var channelName = player.GetChannelName(currentChanelID);
captionText.innerText = channelName;
}
}